package com.elong.businesstravel.protocol.unionlogin;

import org.apache.http.Header;
import org.apache.http.HttpResponse;
import org.apache.http.client.HttpResponseException;
import org.json.JSONException;
import org.json.JSONObject;

import com.android.support.jhf.debug.DebugLog;
import com.android.support.jhf.network.ErrorExceptionHandler;
import com.android.support.jhf.network.loopj.android.http.ResponseHandlerInterface;
import com.android.support.jhf.network.loopj.android.http.TextHttpResponseHandler;
import com.elong.businesstravel.entitys.AccessToken;
import com.elong.businesstravel.protocol.baseresponse.BaseELongJsonHttpResponse;
import com.elong.businesstravel.protocol.baseresponse.BaseWeChatJsonHttpResponse;

abstract public class GetOpenIdResponse extends BaseWeChatJsonHttpResponse {

	protected AccessToken accessToken = new AccessToken();

	
	@Override
	public void onSuccess(int statusCode, Header[] headers,
			JSONObject mainJsonObject) throws Throwable {
		accessToken.access_token = mainJsonObject.optString("access_token","");
		accessToken.expires_in = mainJsonObject.optString("expires_in","");
		accessToken.refresh_token = mainJsonObject.optString("refresh_token","");
		accessToken.openid = mainJsonObject.optString("openid","");
		accessToken.scope = mainJsonObject.optString("scope","");			
	}
	
}
